RawFilePath conversion of System.Directory
authorJoey Hess <joeyh@joeyh.name>
Mon, 20 Jan 2025 22:03:26 +0000 (18:03 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 20 Jan 2025 23:17:33 +0000 (19:17 -0400)
commit1ceece3108f03badcca0d9c64cd287f9352656b3
tree4ac75894d5abcad53a1011da8205d5aab99d8ba3
parente5be81f8d4bf7f6cef5ac4ff0b059efbdf6055ea
RawFilePath conversion of System.Directory

By using System.Directory.OsPath, which takes and returns OsString,
which is a ShortByteString. So, things like dirContents currently have the
overhead of copying that to a ByteString, but that should be less than
the overhead of using Strings which often in turn were converted to
RawFilePaths.

Added Utility.OsString and the OsString build flag. That flag is turned
on in the stack.yaml, and will be turned on automatically by cabal when
built with new enough libraries. The stack.yaml change is a bit ugly,
and that could be reverted for now if it causes any problems.

Note that Utility.OsString.toOsString on windows is avoiding only a
check of encoding that is documented as being unlikely to fail. I don't
think it can fail in git-annex; if it could, git-annex didn't contain
such an encoding check before, so at worst that should be a wash.
34 files changed:
Annex/AdjustedBranch/Merge.hs
Annex/Branch.hs
Annex/Content.hs
Annex/RepoSize/LiveUpdate.hs
Annex/Ssh.hs
Annex/Tmp.hs
Annex/YoutubeDl.hs
Assistant/Repair.hs
Assistant/Threads/TransferWatcher.hs
Assistant/Upgrade.hs
Assistant/WebApp/Configurators/Delete.hs
Build/LinuxMkLibs.hs
CmdLine/GitRemoteAnnex.hs
CmdLine/Seek.hs
Command/P2PHttp.hs
Command/Uninit.hs
Git/Objects.hs
Git/Repair.hs
Logs/Transfer.hs
Remote/BitTorrent.hs
Remote/Directory.hs
Remote/Helper/Git.hs
Test/Framework.hs
Types/Direction.hs
Upgrade/V2.hs
Utility/DirWatcher/INotify.hs
Utility/DirWatcher/Kqueue.hs
Utility/Directory.hs
Utility/Directory/Stream.hs
Utility/LockFile/PidLock.hs
Utility/OsString.hs [new file with mode: 0644]
doc/todo/RawFilePath_conversion.mdwn
git-annex.cabal
stack.yaml